<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;
use backend\models\Country;
use yii\widgets\ActiveForm;
use yii\helpers\Url;
use backend\assets\KartikAsset;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\PackageEaseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '资产包列表';
$this->params['breadcrumbs'][] = ['label' => '全部资产包', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => '我上传的资产包', 'url' => ['index', 'PackageEaseSearch[owner]' => Yii::$app->user->id]];


KartikAsset::register($this);

$importJs = <<<IMPORT
    $(document).ready(function () {
        $("#package_file").fileinput({
                browseLabel:'选择文件',
                language:'zh',
                showBrowse:false,
                showCaption: false,
                dropZoneTitle:'点击或拖拽文件到这里',
                dropZoneClickTitle:'',           
                allowedFileExtensions: ["xls", "xlsx"],
                previewFileIconSettings: {
                    'xls': '<i class="fa fa-file-excel-o text-success"></i>',              
                },
                previewFileExtSettings: {              
                    'xls': function(ext) {
                        return ext.match(/(xls|xlsx)$/i);
                    },              
                },
                browseOnZoneClick: true,
                uploadAsync: true,
                showUpload: true, 
                showRemove: true, 
                showUploadedThumbs: true,
                uploadUrl: $("#import-package-url").val(),
                deleteUrl: "",
    
            }).on('fileloaded', function(event, file, previewId, index, reader) {
    
            }).on('filebatchselected', function(event, files) {
                // console.log(files);
            })
    })
IMPORT;
$js = <<<JS
 $(function() {   
    $('[data-toggle="tooltip"]').tooltip()
    var migration=function(){
      var package_id = $('#kv-grid-package').yiiGridView('getSelectedRows');
      var url=$('#migration_url').val();
      var data={'id':package_id};
      $.post(url,data);
    }
})
JS;

echo '<input type="hidden" id="import-package-url" value="' . Url::to(['package-ease/import']) . '">';

$this->registerJs($importJs);
$this->registerJs($js, \yii\web\View::POS_READY);
echo "<input type='hidden' id='migration_url' value='" . Url::to(['package-migration/package']) . "'/>";
?>
<div class="package-ease-index">
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
    <?php
    $arr_province = Country::localCity('`pid`=0 AND `order`>0');
    echo GridView::widget([
        'id' => 'kv-grid-package',
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'responsive' => false,
        'condensed' => true,
        'hover' => true,
        'striped' => true,
//        'containerOptions' => ['style' => 'overflow: auto'], // only set when $responsive = false
//        'headerRowOptions' => ['class' => 'kartik-sheet-style'],
//        'filterRowOptions' => ['class' => 'kartik-sheet-style'],
        'pjax' => false, // pjax is set to always true for this demo
        'resizableColumns' => true,
        'persistResize' => false,
        'bordered' => true,
//        'perfectScrollbar' => true,
        'floatHeader' => false,
//        'floatHeaderOptions'=>['scrollingTop'=>'0'],
        'toolbar' => [
            [
                'content' =>
                    Html::a('<i class="glyphicon glyphicon-plus"></i>创建', ['create'], ['title' => '创建资产包', 'class' => 'btn btn-success']) .
                    Html::a('<i class="glyphicon glyphicon-repeat"></i>重置', ['index'], ['class' => 'btn btn-default', 'title' => '重置列表']) .
                    Html::button('导入', ['class' => 'btn btn-info', 'title' => '导入资产包', 'data-toggle' => 'modal', 'data-target' => '#importExcelModal']) .
                    Html::a('<i class="glyphicon glyphicon-file"></i>模板', ['download-template'], ['class' => 'btn btn-warning', 'title' => '下载导入模板'])
            ],
//            '{export}',
            '{toggleData}'
        ],
        'panel' => [
            'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i> 资产包</h3>',
            'type' => 'success',
            'footer' => '',
            'after' => '<div class="pull-right">' .
                '<a class="btn btn-primary" data-confirm="确定迁移这些资产包吗？" data-method="post" href="javascript:var migration=function(){
  var package_id = $(\'#kv-grid-package\').yiiGridView(\'getSelectedRows\');
  var url=$(\'#migration_url\').val();
  var data={\'id\':package_id};
  $.post(url,data);
};migration();"><i class="glyphicon glyphicon-download-alt"></i>数据迁移</a>
</div><div class="clearfix"></div>',
        ],
        'columns' => [
            [
                'class' => 'kartik\grid\CheckboxColumn',
                'headerOptions' => ['class' => 'kartik-sheet-style'],
            ],
            ['class' => 'yii\grid\SerialColumn'],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'level',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'value' => function ($model) {
                    return Yii::$app->params['package_ease_level'][$model->level];
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => Yii::$app->params['package_ease_level'],
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '等级'],
                'format' => 'raw',
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_WIDGET,
                    'widgetClass' => \kartik\editable\Editable::INPUT_SELECT2,
                    'options' => [
                        'data' => Yii::$app->params['package_ease_level'],
                    ],
                ],
            ],
            [
                'attribute' => 'title',
                'format' => 'raw',
                'value' => function ($model) {
                    if ($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal'])) {
                        return "<span title='" . $model->title . "' data-toggle='tooltip' data-placement='top'>" . Html::a(mb_strcut($model->title, 0, 30), ['update', 'id' => $model->id]) . "</span>";
                    } else {
                        return "<span title='" . $model->title . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->title, 0, 30) . "</span>";
                    }
                }
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'type',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'value' => function ($model) {
                    return Yii::$app->params['package_ease_type'][$model->type];
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => Yii::$app->params['package_ease_type'],
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '资产包类型'],
                'format' => 'raw',
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_WIDGET,
                    'widgetClass' => \kartik\editable\Editable::INPUT_SELECT2,
                    'options' => [
                        'data' => Yii::$app->params['package_ease_type'],
                    ],
                ],
            ],
            [
//                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'province',
                'vAlign' => 'middle',
                'hAlign' => 'middle',
                'value' => function ($model) {
                    return Country::findOne($model->province)->title;
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => $arr_province,
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '省份'],
                'format' => 'raw',
//                'editableOptions' => [
//                    'asPopover' => true,
//                    'inputType' => \kartik\editable\Editable::INPUT_WIDGET,
//                    'widgetClass' => \kartik\editable\Editable::INPUT_SELECT2,
//                    'options' => [
//                        'data' => $arr_province,
//                    ],
//                ],
            ],
            [
//                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'city',
                'vAlign' => 'middle',
                'value' => function ($model) {
                    if ($model->city) {
                        $modelCountry = new Country();
                        $city = implode(',', $modelCountry->getProvinces("id in ($model->city)"));
                    } else {
                        $city = '';
                    }
                    return "<span title='" . $city . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($city, 0, 12) . "</span>";
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => $searchModel->province ? Country::localCity("`pid`=" . $searchModel->province) : [],
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '城市'],
                'format' => 'raw',
//                'editableOptions' => [
//                    'asPopover' => true,
//                    'inputType' => \kartik\editable\Editable::INPUT_WIDGET,
//                    'widgetClass' => \kartik\editable\Editable::INPUT_SELECT2,
//                    'options' => [
//                        'data' => function ($model) {
//                            return $model->province;
////                            return $model->province ? Country::localCity("`pid`=" . $model->province) : [];
//                        }
//                    ],
//                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'creditor',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'value' => function ($model) {
                    return preg_replace('/中国|资产管理|股份|有限公司/', '', $model->creditor);
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_TEXT,
                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'hushu',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_TEXT,
                ],
            ],
//            'principal:decimal',
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'principal',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . Yii::$app->format->formatCurrency($model->principal) . "' data-toggle='tooltip' data-placement='top'>" . Yii::$app->formatter->asDecimal($model->principal) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_TEXT,
                ],
            ],
            // 'principal_range',
//            'interest:decimal',
//            'principal_interest:decimal',

            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'price',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . Yii::$app->format->formatCurrency($model->price) . "' data-toggle='tooltip' data-placement='top'>" . Yii::$app->formatter->asDecimal($model->price) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_TEXT,
                ],
            ],
//            'hushu_suit',
//            'principle_suit:decimal',
//            'percent_principle_suit',
//             'origin',
            [
                'class' => 'kartik\grid\EditableColumn',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'attribute' => 'discount',
                'editableOptions' => [
                    'asPopover' => true,
                    'inputType' => \kartik\editable\Editable::INPUT_TEXT,
                ],
            ],
            [
                'attribute' => 'packageEaseTransfer.transfer',
                'label' => '联系信息',
                'format' => 'raw',
                'value' => function ($model) {
                    if ($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal'])) {
                        $arr_contact = $model->packageEaseAllTransfer;
                        if (is_array($arr_contact) && count($arr_contact) > 0) {
                            $str_contact = '';
                            foreach ($arr_contact as $item) {
                                if ($item->transfer == 1) {
                                    $str_contact .= '持包人:' . "\n";
                                } elseif ($item->transfer == 2) {
                                    $str_contact .= '居间人:' . "\n";
                                }
                                $str_contact .= $item->transfer_title . "\n" . $item->contact . "\n" . $item->position . "\n" . $item->phone . "\n" . $item->email . "\n" . $item->address . "\f";
                            }
                        } else {
                            $str_contact = '';
                        }
                        return "<span title='" . $str_contact . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($str_contact, 0, 30) . "</span>";
                    } else {
                        return '';
                    }
                }
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'attribute' => 'other_note',
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . $model->other_note . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->other_note, 0, 30) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'attribute' => 'highlights',
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . $model->highlights . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->highlights, 0, 30) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'packageEaseTransfer.remark',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . $model->packageEaseTransfer->remark . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->packageEaseTransfer->remark, 0, 30) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
                    'formOptions' => ['action' => Url::to(['package-ease/editable-transfer']),],
                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'attribute' => 'follow',
                'format' => 'raw',
                'value' => function ($model) {
                    return "<span title='" . $model->follow . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->follow, 0, 30) . "</span>";
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
                ],
            ],

//            'total_mortgage_principal:decimal',
//            'owner',
            [
                'attribute' => 'owner',
                'value' => function ($model) {
                    return $model->publisher->realname;
                },
                'filterType' => GridView::FILTER_SELECT2,
                'filter' => \backend\models\User::getActiveUsers(),
                'filterWidgetOptions' => [
                    'pluginOptions' => ['allowClear' => true],
                ],
                'filterInputOptions' => ['placeholder' => '上传人'],
                'format' => 'raw',
            ],
            [
                'attribute' => 'updated_at',
                'value' => function ($model) {
                    if ($model->updated_at > 0) {
                        return date('Y-m-d', strtotime($model->updated_at));
                    } else {
                        return '';
                    }
                }
            ],
//            'packageEaseTransfer.transfer_title',
//            [
//                'attribute'=>
//            ],
            // 'created_at',
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'published_at',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'value' => function ($model) {
                    if ($model->published_at > 0) {
                        return date('Y-m-d', strtotime($model->published_at));
                    } else {
                        return '';
                    }
                },
                'hAlign' => 'center',
                'vAlign' => 'middle',
//                'width' => '9%',
//                'format' => 'date',
//                'xlFormat' => "yyyy\\-mmm\\-dd\\',
                'headerOptions' => ['class' => 'kv-sticky-column'],
                'contentOptions' => ['class' => 'kv-sticky-column'],
                'editableOptions' => [
                    'header' => '',
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_WIDGET,
//                    'formOptions' => ['action' => Url::to(['package-ease/editable']),],
                    'showAjaxErrors' => true,
                    'widgetClass' => 'kartik\datecontrol\DateControl',
                    'options' => [
                        'type' => \kartik\datecontrol\DateControl::FORMAT_DATE,
//                        'displayTimezone'=>'en',
                        'displayFormat' => 'yyyy-MM-dd',
                        'saveFormat' => 'php:Y-m-d',
                        'options' => [
                            'pluginOptions' => [
                                'autoclose' => true
                            ]
                        ]
                    ]
                ],
            ],
            [
                'class' => 'kartik\grid\EditableColumn',
                'attribute' => 'origin',
                'readonly' => function ($model, $key, $index, $widget) {
                    return !($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']));
                },
                'format' => 'raw',
                'value' => function ($model) {
                    if ($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal'])) {
                        return "<span title='" . $model->origin . "' data-toggle='tooltip' data-placement='top'>" . mb_strcut($model->origin, 0, 30) . "</span>";
                    } else {
                        return '';
                    }
                },
                'editableOptions' => [
                    'asPopover' => true,
                    'size' => 'md',
                    'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
                ],
            ],
            [
                'class' => 'kartik\grid\BooleanColumn',
                'attribute' => 'is_migrated',
                'trueLabel' => '已迁移',
                'falseLabel' => '未迁移'
            ],
            ['class' => 'yii\grid\ActionColumn', 'template' => '{update} {delete} {origin} {import}',
                'buttons' => [
                    'update' => function ($url, $model, $key) {
                        return $model->owner == Yii::$app->user->id ? Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['package-ease/update', 'id' => $model->id]) : '';
                    },
                    'delete' => function ($url, $model, $key) {
                        return $model->owner == Yii::$app->user->id ? Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
                            'data-confirm' => '确定要删除吗？',
                            'data-method' => 'post',
                        ]) : '';
                    },
                    'origin' => function ($url, $model, $key) {
                        if (preg_match('/[a-zA-z]+:\/\/[^\s]*/', $model->origin, $result) && ($model->owner == Yii::$app->user->id || in_array(Yii::$app->user->identity->realname, Yii::$app->params['package_ease_personal']))) {
                            return Html::a('<span class="glyphicon glyphicon-camera"></span>', $result[0], ['target' => '_blank']);
                        } else {
                            return;
                        }

                    },
                    'import' => function ($url, $model, $key) {
                        return $model->owner == Yii::$app->user->id ? '<button type="button" class="btn btn-info" title="导入项目" onclick="javascript:
                            $(\'#project_file\').fileinput({
                                browseLabel:\'选择文件\',
                                language:\'zh\',
                                showBrowse:false,
                                showCaption: false,
                                dropZoneTitle:\'点击或拖拽文件到这里\',
                                dropZoneClickTitle:\'\',           
                                allowedFileExtensions: [\'xls\', \'xlsx\'],
                                browseOnZoneClick: true,
                                uploadAsync: true,
                                showUpload: true, 
                                showRemove: true, 
                                showUploadedThumbs: true,
                                uploadUrl: \'' . Url::to(["project-ease/import", "package_id" => $model->id]) . '\',
                                });" 
                                data-toggle="modal" data-target="#importProjectExcelModal" >导入项目</button>' : '';
                    }
                ],
            ],

        ],
    ]);

    ?>
</div>

<!-- Modal -->
<div class="modal fade" id="importExcelModal" tabindex="-1" role="dialog" aria-labelledby="importExcelModalLabel"
     aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="importExcelModalLabel">导入资产包</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <?php ActiveForm::begin(['action' => ['/package-ease/import'], 'method' => 'post', 'options' => ['enctype' => "multipart/form-data"]]) ?>
            <div class="modal-body">
                <div class="file-loading">
                    <input id="package_file" name="package_file" type="file"'>
                </div>
                <div id="kartik-file-errors"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
            <?php ActiveForm::end() ?>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="importProjectExcelModal" tabindex="-1" role="dialog"
     aria-labelledby="importProjectExcelModalLabel"
     aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="importProjectExcelModalLabel">导入项目</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <?php //ActiveForm::begin(['action' => ['/project-ease/import'], 'method' => 'post', 'options' => ['enctype' => "multipart/form-data"]]) ?>
            <div class="modal-body">
                <div class="file-loading">
                    <input id="project_file" name="project_file" type="file"'>
                </div>
                <div id="kartik-file-errors"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal"
                        onclick="javascript:window.location.reload();">关闭
                </button>
                <?= Html::a('查看项目列表', ['project-ease/index'], ['class' => 'btn btn-info', 'target' => '_blank']) ?>
                <!--                <button type="submit" class="btn btn-primary">提交</button>-->
            </div>
            <?php //ActiveForm::end() ?>
        </div>
    </div>
</div>
